package client;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;

import surname.protocol.AbstractRequest;

public class Emission 
{
	private Socket socket;
	private ObjectOutputStream os;
	
	public Emission(Socket s)
	{
		socket = s;
		try 
		{
			os = new ObjectOutputStream(socket.getOutputStream());
		} 
		catch (IOException e) 
		{
			e.printStackTrace();
		}
	}
	
	public boolean send(AbstractRequest request)
	{
		try 
		{
			os.writeObject(request);
			return true;
		} 
		catch (IOException e) 
		{
			return false;
		}
	}

}
